package com.atguigu.gmall.cart.config;

import com.atguigu.gmall.cart.handler.CartExceptionHandler;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executor;

/**
 * @author fenge
 */
@Component
public class AsyncConfig implements AsyncConfigurer {

    @Autowired
    private CartExceptionHandler cartExceptionHandler;

    @Override
    public Executor getAsyncExecutor() {
        return null;
    }

    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {

        return cartExceptionHandler;
    }
}
